package apiday05.exception;

import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseableDemo {
    public static void main(String[] args) {


        try (FileOutputStream fos = new FileOutputStream("demo.txt")){
            fos.write(2);
        } catch (IOException e) {
            System.out.println("出错了");
        }
    }
}
